<!DOCTYPE html>
<html lang="zh-CN" data-theme="light">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1" />
    <meta name="generator" content="VuePress 2.0.0-beta.53" />
    <meta name="theme" content="VuePress Theme Hope" />
    <link rel="icon" href="/doc/images/favicon.ico"><title>基础掌握 | AT 的文档库</title><meta name="description" content="At 的文档库，好记性不如烂笔头！">
    <style>
      :root {
        --bg-color: #fff;
      }

      html[data-theme="dark"] {
        --bg-color: #1d2025;
      }

      html,
      body {
        background: var(--bg-color);
      }
    </style>
    <script>
      const userMode = localStorage.getItem("vuepress-theme-hope-scheme");
      const systemDarkMode =
        window.matchMedia &&
        window.matchMedia("(prefers-color-scheme: dark)").matches;

      if (userMode === "dark" || (userMode !== "light" && systemDarkMode)) {
        document.querySelector("html").setAttribute("data-theme", "dark");
      }
    </script>
    <link rel="preload" href="/doc/assets/style.c3a4c10b.css" as="style" /><link rel="stylesheet" href="/doc/assets/style.c3a4c10b.css" />
    <link rel="modulepreload" href="/doc/assets/app.41440b49.js"><link rel="modulepreload" href="/doc/assets/基础掌握.html.5135d2c4.js"><link rel="modulepreload" href="/doc/assets/_plugin-vue_export-helper.cdc0426e.js"><link rel="modulepreload" href="/doc/assets/基础掌握.html.d839cc53.js"><link rel="prefetch" href="/doc/assets/index.html.0bcc895f.js" as="script" /><link rel="prefetch" href="/doc/assets/index.html.c8df2167.js" as="script" /><link rel="prefetch" href="/doc/assets/Vue2.html.48e096c5.js" as="script" /><link rel="prefetch" href="/doc/assets/Vue3.html.324e646c.js" as="script" /><link rel="prefetch" href="/doc/assets/index.html.fb0ad0e0.js" as="script" /><link rel="prefetch" href="/doc/assets/第 1 章 导言.html.d6c662f8.js" as="script" /><link rel="prefetch" href="/doc/assets/第 2 章 TypeScript 概述.html.e976154a.js" as="script" /><link rel="prefetch" href="/doc/assets/第 3 章 类型全解.html.e4f1b931.js" as="script" /><link rel="prefetch" href="/doc/assets/第 4 章 函数.html.701a2968.js" as="script" /><link rel="prefetch" href="/doc/assets/第 5 章 类和接口.html.8988d546.js" as="script" /><link rel="prefetch" href="/doc/assets/第 6 章 类型进阶.html.45b313e3.js" as="script" /><link rel="prefetch" href="/doc/assets/index.html.a9dd6465.js" as="script" /><link rel="prefetch" href="/doc/assets/index.html.a3374cf8.js" as="script" /><link rel="prefetch" href="/doc/assets/面试题详解.html.c326eaaf.js" as="script" /><link rel="prefetch" href="/doc/assets/index.html.88582229.js" as="script" /><link rel="prefetch" href="/doc/assets/常见问题.html.e0f65550.js" as="script" /><link rel="prefetch" href="/doc/assets/扩展使用.html.87cccc41.js" as="script" /><link rel="prefetch" href="/doc/assets/掌握 GIT.html.c150b234.js" as="script" /><link rel="prefetch" href="/doc/assets/index.html.a3c2858b.js" as="script" /><link rel="prefetch" href="/doc/assets/面试题详解.html.9a53d157.js" as="script" /><link rel="prefetch" href="/doc/assets/index.html.101afd82.js" as="script" /><link rel="prefetch" href="/doc/assets/面试题详解.html.8224e1cd.js" as="script" /><link rel="prefetch" href="/doc/assets/index.html.54b5ca2d.js" as="script" /><link rel="prefetch" href="/doc/assets/index.html.80e4d5cc.js" as="script" /><link rel="prefetch" href="/doc/assets/基础掌握.html.9a178a04.js" as="script" /><link rel="prefetch" href="/doc/assets/扩展知识.html.3535ab30.js" as="script" /><link rel="prefetch" href="/doc/assets/项目搭建.html.e926587b.js" as="script" /><link rel="prefetch" href="/doc/assets/index.html.881e95b0.js" as="script" /><link rel="prefetch" href="/doc/assets/安装及使用.html.ba7314a3.js" as="script" /><link rel="prefetch" href="/doc/assets/index.html.f9509ce0.js" as="script" /><link rel="prefetch" href="/doc/assets/第 1 章.html.726a0bb9.js" as="script" /><link rel="prefetch" href="/doc/assets/第 2 章.html.38f55e7d.js" as="script" /><link rel="prefetch" href="/doc/assets/Controllers.html.6b27764c.js" as="script" /><link rel="prefetch" href="/doc/assets/Module.html.3849b10b.js" as="script" /><link rel="prefetch" href="/doc/assets/Providers.html.7d2793f1.js" as="script" /><link rel="prefetch" href="/doc/assets/404.html.c5de7dd9.js" as="script" /><link rel="prefetch" href="/doc/assets/index.html.86b08b0b.js" as="script" /><link rel="prefetch" href="/doc/assets/index.html.f4119260.js" as="script" /><link rel="prefetch" href="/doc/assets/Vue2.html.caf7eb18.js" as="script" /><link rel="prefetch" href="/doc/assets/Vue3.html.6dc23cf4.js" as="script" /><link rel="prefetch" href="/doc/assets/index.html.868f2c80.js" as="script" /><link rel="prefetch" href="/doc/assets/第 1 章 导言.html.9edf000e.js" as="script" /><link rel="prefetch" href="/doc/assets/第 2 章 TypeScript 概述.html.76b27e4d.js" as="script" /><link rel="prefetch" href="/doc/assets/第 3 章 类型全解.html.9ad8a3d4.js" as="script" /><link rel="prefetch" href="/doc/assets/第 4 章 函数.html.9115df00.js" as="script" /><link rel="prefetch" href="/doc/assets/第 5 章 类和接口.html.e392a0d1.js" as="script" /><link rel="prefetch" href="/doc/assets/第 6 章 类型进阶.html.1b5b864e.js" as="script" /><link rel="prefetch" href="/doc/assets/index.html.e5a75968.js" as="script" /><link rel="prefetch" href="/doc/assets/index.html.974654cf.js" as="script" /><link rel="prefetch" href="/doc/assets/面试题详解.html.ed3fa7a3.js" as="script" /><link rel="prefetch" href="/doc/assets/index.html.3b9ebcaa.js" as="script" /><link rel="prefetch" href="/doc/assets/常见问题.html.b427e39a.js" as="script" /><link rel="prefetch" href="/doc/assets/扩展使用.html.76b3dd90.js" as="script" /><link rel="prefetch" href="/doc/assets/掌握 GIT.html.724416fc.js" as="script" /><link rel="prefetch" href="/doc/assets/index.html.8b55f9ef.js" as="script" /><link rel="prefetch" href="/doc/assets/面试题详解.html.8ee968a7.js" as="script" /><link rel="prefetch" href="/doc/assets/index.html.06371751.js" as="script" /><link rel="prefetch" href="/doc/assets/面试题详解.html.6b672044.js" as="script" /><link rel="prefetch" href="/doc/assets/index.html.b200eaff.js" as="script" /><link rel="prefetch" href="/doc/assets/index.html.557b7bf5.js" as="script" /><link rel="prefetch" href="/doc/assets/基础掌握.html.7b535b09.js" as="script" /><link rel="prefetch" href="/doc/assets/扩展知识.html.c6b233af.js" as="script" /><link rel="prefetch" href="/doc/assets/项目搭建.html.450f0b1d.js" as="script" /><link rel="prefetch" href="/doc/assets/index.html.6483ed06.js" as="script" /><link rel="prefetch" href="/doc/assets/安装及使用.html.b4d859f3.js" as="script" /><link rel="prefetch" href="/doc/assets/index.html.f15cf3e9.js" as="script" /><link rel="prefetch" href="/doc/assets/第 1 章.html.127b1e7c.js" as="script" /><link rel="prefetch" href="/doc/assets/第 2 章.html.ea8e67e2.js" as="script" /><link rel="prefetch" href="/doc/assets/Controllers.html.029df1e7.js" as="script" /><link rel="prefetch" href="/doc/assets/Module.html.f102db2a.js" as="script" /><link rel="prefetch" href="/doc/assets/Providers.html.9bef3753.js" as="script" /><link rel="prefetch" href="/doc/assets/404.html.2cfd6b20.js" as="script" /><link rel="prefetch" href="/doc/assets/photoswipe.esm.09e03fed.js" as="script" />
  </head>
  <body>
    <div id="app"><!--[--><!--[--><!--[--><span tabindex="-1"></span><a href="#main-content" class="skip-link sr-only">Skip to content</a><!--]--><div class="theme-container has-toc"><!--[--><!--[--><header class="navbar"><div class="navbar-left"><button class="toggle-sidebar-button" title="Toggle Sidebar"><span class="icon"></span></button><!--[--><!----><!--]--><a href="/doc/" class="brand"><!----><!----><span class="site-name">AT 的文档库</span></a><!--[--><!----><!--]--></div><div class="navbar-center"><!--[--><!----><!--]--><nav class="nav-links"><div class="nav-item hide-in-mobile"><a href="/doc/" class="nav-link" aria-label="首页"><!---->首页<!----></a></div><div class="nav-item hide-in-mobile"><div class="dropdown-wrapper"><button class="dropdown-title" type="button" aria-label="开发问题汇总"><span class="title"><!---->开发问题汇总</span><span class="arrow"></span><ul class="nav-dropdown"><li class="dropdown-item"><a href="/doc/development-question/Vue" class="nav-link" aria-label="Vue"><!---->Vue<!----></a></li></ul></button></div></div><div class="nav-item hide-in-mobile"><div class="dropdown-wrapper"><button class="dropdown-title" type="button" aria-label="系统笔记"><span class="title"><!---->系统笔记</span><span class="arrow"></span><ul class="nav-dropdown"><li class="dropdown-item"><a href="/doc/sysnotes/Git/%E6%8E%8C%E6%8F%A1%20GIT.html" class="nav-link" aria-label="GIT"><!---->GIT<!----></a></li><li class="dropdown-item"><a href="/doc/sysnotes/Nvm/%E5%AE%89%E8%A3%85%E5%8F%8A%E4%BD%BF%E7%94%A8.html" class="nav-link" aria-label="NVM"><!---->NVM<!----></a></li><li class="dropdown-item"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html" class="router-link-active router-link-exact-active nav-link active" aria-label="Linux"><!---->Linux<!----></a></li><li class="dropdown-item"><a href="/doc/sysnotes/JavaScript" class="nav-link" aria-label="JavaScript"><!---->JavaScript<!----></a></li><li class="dropdown-item"><a href="/doc/sysnotes/CSS" class="nav-link" aria-label="CSS"><!---->CSS<!----></a></li><li class="dropdown-item"><a href="/doc/sysnotes/HTML" class="nav-link" aria-label="HTML"><!---->HTML<!----></a></li></ul></button></div></div><div class="nav-item hide-in-mobile"><div class="dropdown-wrapper"><button class="dropdown-title" type="button" aria-label="阅读笔记"><span class="title"><!---->阅读笔记</span><span class="arrow"></span><ul class="nav-dropdown"><li class="dropdown-item"><a href="/doc/readbook/《Vue.js 设计与实现》/" class="nav-link" aria-label="《Vue.js 设计与实现》"><!---->《Vue.js 设计与实现》<!----></a></li><li class="dropdown-item"><a href="/doc/readbook/《TypeScript 编程》/" class="nav-link" aria-label="《TypeScript 编程》"><!---->《TypeScript 编程》<!----></a></li></ul></button></div></div></nav><!--[--><!----><!--]--></div><div class="navbar-right"><!--[--><!----><!--]--><div class="nav-item hide-in-mobile"><button id="appearance-switch"><svg xmlns="http://www.w3.org/2000/svg" class="icon auto-icon" viewBox="0 0 1024 1024" fill="currentColor" aria-label="auto icon" style="display:block;"><path d="M512 992C246.92 992 32 777.08 32 512S246.92 32 512 32s480 214.92 480 480-214.92 480-480 480zm0-840c-198.78 0-360 161.22-360 360 0 198.84 161.22 360 360 360s360-161.16 360-360c0-198.78-161.22-360-360-360zm0 660V212c165.72 0 300 134.34 300 300 0 165.72-134.28 300-300 300z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" class="icon dark-icon" viewBox="0 0 1024 1024" fill="currentColor" aria-label="dark icon" style="display:none;"><path d="M524.8 938.667h-4.267a439.893 439.893 0 0 1-313.173-134.4 446.293 446.293 0 0 1-11.093-597.334A432.213 432.213 0 0 1 366.933 90.027a42.667 42.667 0 0 1 45.227 9.386 42.667 42.667 0 0 1 10.24 42.667 358.4 358.4 0 0 0 82.773 375.893 361.387 361.387 0 0 0 376.747 82.774 42.667 42.667 0 0 1 54.187 55.04 433.493 433.493 0 0 1-99.84 154.88 438.613 438.613 0 0 1-311.467 128z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" class="icon light-icon" viewBox="0 0 1024 1024" fill="currentColor" aria-label="light icon" style="display:none;"><path d="M952 552h-80a40 40 0 0 1 0-80h80a40 40 0 0 1 0 80zM801.88 280.08a41 41 0 0 1-57.96-57.96l57.96-58a41.04 41.04 0 0 1 58 58l-58 57.96zM512 752a240 240 0 1 1 0-480 240 240 0 0 1 0 480zm0-560a40 40 0 0 1-40-40V72a40 40 0 0 1 80 0v80a40 40 0 0 1-40 40zm-289.88 88.08-58-57.96a41.04 41.04 0 0 1 58-58l57.96 58a41 41 0 0 1-57.96 57.96zM192 512a40 40 0 0 1-40 40H72a40 40 0 0 1 0-80h80a40 40 0 0 1 40 40zm30.12 231.92a41 41 0 0 1 57.96 57.96l-57.96 58a41.04 41.04 0 0 1-58-58l58-57.96zM512 832a40 40 0 0 1 40 40v80a40 40 0 0 1-80 0v-80a40 40 0 0 1 40-40zm289.88-88.08 58 57.96a41.04 41.04 0 0 1-58 58l-57.96-58a41 41 0 0 1 57.96-57.96z"></path></svg></button></div><form class="search-box" role="search"><input type="search" autocomplete="off" spellcheck="false" value><!----></form><!--[--><!----><!--]--><button class="toggle-navbar-button" aria-label="Toggle Navbar" aria-expanded="false" aria-controls="nav-screen"><span class="button-container"><span class="button-top"></span><span class="button-middle"></span><span class="button-bottom"></span></span></button></div></header><!----><!--]--><!----><div class="toggle-sidebar-wrapper"><span class="arrow left"></span></div><aside class="sidebar"><!--[--><!----><!--]--><ul class="sidebar-links"><li><section class="sidebar-group"><button class="sidebar-heading clickable"><!----><span class="title">CSS</span><span class="arrow right"></span></button><!----></section></li><li><section class="sidebar-group"><button class="sidebar-heading clickable"><!----><span class="title">GIT</span><span class="arrow right"></span></button><!----></section></li><li><section class="sidebar-group"><button class="sidebar-heading clickable"><!----><span class="title">HTML</span><span class="arrow right"></span></button><!----></section></li><li><section class="sidebar-group"><button class="sidebar-heading clickable"><!----><span class="title">JavaScript</span><span class="arrow right"></span></button><!----></section></li><li><section class="sidebar-group"><button class="sidebar-heading clickable active"><!----><span class="title">Linux</span><span class="arrow down"></span></button><ul class="sidebar-links"><li><!--[--><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html" class="router-link-active router-link-exact-active nav-link active sidebar-link sidebar-page active" aria-label="基础掌握"><!---->基础掌握<!----></a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#查看启动文件" class="router-link-active router-link-exact-active nav-link sidebar-link heading" aria-label="查看启动文件"><!---->查看启动文件<!----></a><ul class="sidebar-sub-headers"></ul></li><li class="sidebar-sub-header"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#进程" class="router-link-active router-link-exact-active nav-link sidebar-link heading" aria-label="进程"><!---->进程<!----></a><ul class="sidebar-sub-headers"></ul></li><li class="sidebar-sub-header"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#解压文件" class="router-link-active router-link-exact-active nav-link sidebar-link heading" aria-label="解压文件"><!---->解压文件<!----></a><ul class="sidebar-sub-headers"></ul></li><li class="sidebar-sub-header"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#文件夹操作" class="router-link-active router-link-exact-active nav-link sidebar-link heading" aria-label="文件夹操作"><!---->文件夹操作<!----></a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#移动文件" class="router-link-active router-link-exact-active nav-link sidebar-link heading" aria-label="移动文件"><!---->移动文件<!----></a><ul class="sidebar-sub-headers"></ul></li><li class="sidebar-sub-header"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#清空文件内容" class="router-link-active router-link-exact-active nav-link sidebar-link heading" aria-label="清空文件内容"><!---->清空文件内容<!----></a><ul class="sidebar-sub-headers"></ul></li><li class="sidebar-sub-header"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#创建文件夹" class="router-link-active router-link-exact-active nav-link sidebar-link heading" aria-label="创建文件夹"><!---->创建文件夹<!----></a><ul class="sidebar-sub-headers"></ul></li><li class="sidebar-sub-header"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#修改文件归属" class="router-link-active router-link-exact-active nav-link sidebar-link heading" aria-label="修改文件归属"><!---->修改文件归属<!----></a><ul class="sidebar-sub-headers"></ul></li><li class="sidebar-sub-header"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#修改文件权限" class="router-link-active router-link-exact-active nav-link sidebar-link heading" aria-label="修改文件权限"><!---->修改文件权限<!----></a><ul class="sidebar-sub-headers"></ul></li></ul></li><li class="sidebar-sub-header"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#防火墙" class="router-link-active router-link-exact-active nav-link sidebar-link heading" aria-label="防火墙"><!---->防火墙<!----></a><ul class="sidebar-sub-headers"></ul></li><li class="sidebar-sub-header"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#vim-命令详解" class="router-link-active router-link-exact-active nav-link sidebar-link heading" aria-label="vim 命令详解"><!---->vim 命令详解<!----></a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#多行注释" class="router-link-active router-link-exact-active nav-link sidebar-link heading" aria-label="多行注释"><!---->多行注释<!----></a><ul class="sidebar-sub-headers"></ul></li></ul></li><li class="sidebar-sub-header"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#定时任务" class="router-link-active router-link-exact-active nav-link sidebar-link heading" aria-label="定时任务"><!---->定时任务<!----></a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#常用定时任务命令" class="router-link-active router-link-exact-active nav-link sidebar-link heading" aria-label="常用定时任务命令"><!---->常用定时任务命令<!----></a><ul class="sidebar-sub-headers"></ul></li><li class="sidebar-sub-header"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#cron-定时任务表达式" class="router-link-active router-link-exact-active nav-link sidebar-link heading" aria-label="Cron 定时任务表达式"><!---->Cron 定时任务表达式<!----></a><ul class="sidebar-sub-headers"></ul></li></ul></li><li class="sidebar-sub-header"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#其余命令" class="router-link-active router-link-exact-active nav-link sidebar-link heading" aria-label="其余命令"><!---->其余命令<!----></a><ul class="sidebar-sub-headers"></ul></li><li class="sidebar-sub-header"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#搜索文件内容" class="router-link-active router-link-exact-active nav-link sidebar-link heading" aria-label="搜索文件内容"><!---->搜索文件内容<!----></a><ul class="sidebar-sub-headers"></ul></li></ul><!--]--></li></ul></section></li><li><section class="sidebar-group"><button class="sidebar-heading clickable"><!----><span class="title">NestJs</span><span class="arrow right"></span></button><!----></section></li><li><section class="sidebar-group"><button class="sidebar-heading clickable"><!----><span class="title">NVM</span><span class="arrow right"></span></button><!----></section></li></ul><!--[--><!----><!--]--></aside><!--[--><main class="page" id="main-content"><!--[--><!----><nav class="breadcrumb disable"></nav><div class="page-title"><h1><!---->基础掌握</h1><div class="page-info"><!----><!----><span class="date-info" aria-label="写作日期📅" data-balloon-pos="down"><svg xmlns="http://www.w3.org/2000/svg" class="icon calendar-icon" viewBox="0 0 1024 1024" fill="currentColor" aria-label="calendar icon"><path d="M716.4 110.137c0-18.753-14.72-33.473-33.472-33.473-18.753 0-33.473 14.72-33.473 33.473v33.473h66.993v-33.473zm-334.87 0c0-18.753-14.72-33.473-33.473-33.473s-33.52 14.72-33.52 33.473v33.473h66.993v-33.473zm468.81 33.52H716.4v100.465c0 18.753-14.72 33.473-33.472 33.473a33.145 33.145 0 01-33.473-33.473V143.657H381.53v100.465c0 18.753-14.72 33.473-33.473 33.473a33.145 33.145 0 01-33.473-33.473V143.657H180.6A134.314 134.314 0 0046.66 277.595v535.756A134.314 134.314 0 00180.6 947.289h669.74a134.36 134.36 0 00133.94-133.938V277.595a134.314 134.314 0 00-133.94-133.938zm33.473 267.877H147.126a33.145 33.145 0 01-33.473-33.473c0-18.752 14.72-33.473 33.473-33.473h736.687c18.752 0 33.472 14.72 33.472 33.473a33.145 33.145 0 01-33.472 33.473z"></path></svg><span>2022年12月22日</span><meta property="datePublished" content="2022-12-22T08:15:58.000Z"></span><!----><!----><span class="reading-time-info" aria-label="阅读时间⌛" data-balloon-pos="down"><svg xmlns="http://www.w3.org/2000/svg" class="icon timer-icon" viewBox="0 0 1024 1024" fill="currentColor" aria-label="timer icon"><path d="M799.387 122.15c4.402-2.978 7.38-7.897 7.38-13.463v-1.165c0-8.933-7.38-16.312-16.312-16.312H256.33c-8.933 0-16.311 7.38-16.311 16.312v1.165c0 5.825 2.977 10.874 7.637 13.592 4.143 194.44 97.22 354.963 220.201 392.763-122.204 37.542-214.893 196.511-220.2 389.397-4.661 5.049-7.638 11.651-7.638 19.03v5.825h566.49v-5.825c0-7.379-2.849-13.981-7.509-18.9-5.049-193.016-97.867-351.985-220.2-389.527 123.24-37.67 216.446-198.453 220.588-392.892zM531.16 450.445v352.632c117.674 1.553 211.787 40.778 211.787 88.676H304.097c0-48.286 95.149-87.382 213.728-88.676V450.445c-93.077-3.107-167.901-81.297-167.901-177.093 0-8.803 6.99-15.793 15.793-15.793 8.803 0 15.794 6.99 15.794 15.793 0 80.261 63.69 145.635 142.01 145.635s142.011-65.374 142.011-145.635c0-8.803 6.99-15.793 15.794-15.793s15.793 6.99 15.793 15.793c0 95.019-73.789 172.82-165.96 177.093z"></path></svg><span>大约 3 分钟</span><meta property="timeRequired" content="PT3M"></span></div><hr></div><div class="toc-place-holder"><aside id="toc"><div class="toc-header">此页内容</div><div class="toc-wrapper"><ul class="toc-list"><!--[--><li class="toc-item"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#查看启动文件" class="router-link-active router-link-exact-active toc-link level2">查看启动文件</a></li><!----><!--]--><!--[--><li class="toc-item"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#进程" class="router-link-active router-link-exact-active toc-link level2">进程</a></li><!----><!--]--><!--[--><li class="toc-item"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#解压文件" class="router-link-active router-link-exact-active toc-link level2">解压文件</a></li><!----><!--]--><!--[--><li class="toc-item"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#文件夹操作" class="router-link-active router-link-exact-active toc-link level2">文件夹操作</a></li><ul class="toc-list"><!--[--><li class="toc-item"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#移动文件" class="router-link-active router-link-exact-active toc-link level3">移动文件</a></li><!----><!--]--><!--[--><li class="toc-item"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#清空文件内容" class="router-link-active router-link-exact-active toc-link level3">清空文件内容</a></li><!----><!--]--><!--[--><li class="toc-item"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#创建文件夹" class="router-link-active router-link-exact-active toc-link level3">创建文件夹</a></li><!----><!--]--><!--[--><li class="toc-item"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#修改文件归属" class="router-link-active router-link-exact-active toc-link level3">修改文件归属</a></li><!----><!--]--><!--[--><li class="toc-item"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#修改文件权限" class="router-link-active router-link-exact-active toc-link level3">修改文件权限</a></li><!----><!--]--></ul><!--]--><!--[--><li class="toc-item"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#防火墙" class="router-link-active router-link-exact-active toc-link level2">防火墙</a></li><!----><!--]--><!--[--><li class="toc-item"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#vim-命令详解" class="router-link-active router-link-exact-active toc-link level2">vim 命令详解</a></li><ul class="toc-list"><!--[--><li class="toc-item"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#多行注释" class="router-link-active router-link-exact-active toc-link level3">多行注释</a></li><!----><!--]--></ul><!--]--><!--[--><li class="toc-item"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#定时任务" class="router-link-active router-link-exact-active toc-link level2">定时任务</a></li><ul class="toc-list"><!--[--><li class="toc-item"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#常用定时任务命令" class="router-link-active router-link-exact-active toc-link level3">常用定时任务命令</a></li><!----><!--]--><!--[--><li class="toc-item"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#cron-定时任务表达式" class="router-link-active router-link-exact-active toc-link level3">Cron 定时任务表达式</a></li><!----><!--]--></ul><!--]--><!--[--><li class="toc-item"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#其余命令" class="router-link-active router-link-exact-active toc-link level2">其余命令</a></li><!----><!--]--><!--[--><li class="toc-item"><a aria-current="page" href="/doc/sysnotes/Linux/%E5%9F%BA%E7%A1%80%E6%8E%8C%E6%8F%A1.html#搜索文件内容" class="router-link-active router-link-exact-active toc-link level2">搜索文件内容</a></li><!----><!--]--></ul></div></aside></div><!----><div class="theme-hope-content"><h1 id="基础掌握" tabindex="-1"><a class="header-anchor" href="#基础掌握" aria-hidden="true">#</a> 基础掌握</h1><h2 id="查看启动文件" tabindex="-1"><a class="header-anchor" href="#查看启动文件" aria-hidden="true">#</a> 查看启动文件</h2><p>ps -ef | grep nginx</p><h2 id="进程" tabindex="-1"><a class="header-anchor" href="#进程" aria-hidden="true">#</a> 进程</h2><table><thead><tr><th>命令</th><th>备注</th></tr></thead><tbody><tr><td>df</td><td>以磁盘分区为单位查看文件系统，可加上参数查看磁盘剩余情况</td></tr><tr><td>df -hl</td><td>查看磁盘剩余情况</td></tr><tr><td>df -h</td><td>查看每个根路径的分区大小</td></tr><tr><td>du -sm 文件名</td><td>查看文件的总 M 数</td></tr><tr><td>du -sh 文件目录</td><td>查看文件目录的总数</td></tr><tr><td>du -h 文件目录</td><td>查看目录下各个文件的大小</td></tr><tr><td>sudo fsdisk -l</td><td>查看硬盘的分区</td></tr><tr><td>ls -lhS</td><td>查看系统占用磁盘空间最大的文件及让文件按大小排序</td></tr></tbody></table><table><thead><tr><th>Filesystem(文件系统)</th><th>Size(容量)</th><th>Used(已用)</th><th>Avail（可用）</th><th>Use%（已用）</th><th>Mounted on（挂载点）</th></tr></thead><tbody><tr><td>----</td><td>----</td><td>----</td><td>----</td><td>----</td><td>----</td></tr></tbody></table><h2 id="解压文件" tabindex="-1"><a class="header-anchor" href="#解压文件" aria-hidden="true">#</a> 解压文件</h2><p>tar -zxvf</p><h2 id="文件夹操作" tabindex="-1"><a class="header-anchor" href="#文件夹操作" aria-hidden="true">#</a> 文件夹操作</h2><h3 id="移动文件" tabindex="-1"><a class="header-anchor" href="#移动文件" aria-hidden="true">#</a> 移动文件</h3><table><thead><tr><th>mv A B</th><th>将目录A重命名为B</th></tr></thead><tbody><tr><td>mv /a /b/c</td><td>将/a目录移动到/b下，并重命名为c</td></tr></tbody></table><h3 id="清空文件内容" tabindex="-1"><a class="header-anchor" href="#清空文件内容" aria-hidden="true">#</a> 清空文件内容</h3><p><em>&gt; 文件名</em></p><h3 id="创建文件夹" tabindex="-1"><a class="header-anchor" href="#创建文件夹" aria-hidden="true">#</a> 创建文件夹</h3><table><thead><tr><th><strong>命令</strong></th><th><strong>解析</strong></th></tr></thead><tbody><tr><td>mkdir dirname</td><td>创建单个目录</td></tr><tr><td>mkdir -p dirname</td><td>创建多级目录</td></tr><tr><td>mkdir -m=rwx -p a/{b,c}/{d,e}</td><td>创建多级目录,并且权限为 rwx</td></tr></tbody></table><h3 id="修改文件归属" tabindex="-1"><a class="header-anchor" href="#修改文件归属" aria-hidden="true">#</a> 修改文件归属</h3><table><thead><tr><th><strong>命令</strong></th><th><strong>解析</strong></th></tr></thead><tbody><tr><td>chown --version</td><td>查看版本</td></tr><tr><td>chown user:group dirname</td><td></td></tr></tbody></table><p>| user: 用户名 group:组名 示例：chown dev:dev etc 只修改用户：chown dev etc 只修改组：chown :dev etc | | chown -R user:group dir | 递归修改整个目录权限 | | <strong>参数说明</strong> | | | -c | 显示更改的部分的信息 | | -f | 忽略错误信息 | | -h | 修复符号链接 | | -v | 显示详细的处理信息 | | -R | 处理指定目录以及其子目录下的所有文件 | | –help | 显示辅助说明 | | --version | 显示版本 |</p><h3 id="修改文件权限" tabindex="-1"><a class="header-anchor" href="#修改文件权限" aria-hidden="true">#</a> 修改文件权限</h3><blockquote><p>基本语法：字母法 chmod u/g/o/a +/-/= rwx 文件 混合： chmod u=rwx,g=rx,o=r 文件名</p></blockquote><table><thead><tr><th><strong>参数解析</strong></th><th></th></tr></thead><tbody><tr><td><strong>u/g/o/a</strong></td><td><strong>解析</strong></td></tr><tr><td>u</td><td>user 表示文件的所有者</td></tr><tr><td>g</td><td>group 表示文件的所有者属于同一组，及用户组</td></tr><tr><td>o</td><td>other 表示其他以外的人</td></tr><tr><td>a</td><td>all 全部及 u,g,o</td></tr><tr><td><strong>+/-/=</strong></td><td><strong>解析</strong></td></tr><tr><td>+</td><td>增加权限</td></tr><tr><td>-</td><td>删除权限</td></tr><tr><td>=</td><td>设定权限</td></tr><tr><td><strong>rwx</strong></td><td><strong>解析</strong></td></tr><tr><td>r</td><td>read 表示可读取，如果没有 r 权限，则不能通过 ls 查看这个目录内容</td></tr><tr><td>w</td><td>write 表示可写入，对与目录没有 w 权限，则不能在目录下创建文件</td></tr><tr><td>x</td><td>excute 表示可执行，对与目录没有 x 权限，则不能通过 cd 进入目录</td></tr><tr><td><strong>其余参数</strong></td><td><strong>解析</strong></td></tr><tr><td>-R</td><td>-R, --recursive 递归地更改文件和目录</td></tr><tr><td>--version</td><td>查看当前版本</td></tr></tbody></table><h2 id="防火墙" tabindex="-1"><a class="header-anchor" href="#防火墙" aria-hidden="true">#</a> 防火墙</h2><blockquote><p>sudo ufw status 查看防火墙状态 ufw disable 关闭防火墙 ufw enable  开启防火墙 telnet 127.0.0.1 10086  查看某个端口是否开放</p></blockquote><h2 id="vim-命令详解" tabindex="-1"><a class="header-anchor" href="#vim-命令详解" aria-hidden="true">#</a> vim 命令详解</h2><p><a href="https://blog.csdn.net/zxs9999/article/details/79118490" target="_blank" rel="noopener noreferrer">参考文章<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></p><ul><li>:set number/nu 显示行数</li></ul><h3 id="多行注释" tabindex="-1"><a class="header-anchor" href="#多行注释" aria-hidden="true">#</a> 多行注释</h3><p>方法一：</p><ul><li>:10,20s/^/#/g （注释 10-20 行）</li><li>:10,20s/^#//g (取消注释)</li></ul><p>方法二：mac 上不可用</p><ul><li>ctrl + V 进入块模式</li><li>I 进入编辑模式</li><li>输入 # 或 //</li><li>Esc 退出</li></ul><h2 id="定时任务" tabindex="-1"><a class="header-anchor" href="#定时任务" aria-hidden="true">#</a> 定时任务</h2><ol><li>安装定时任务</li></ol><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>yum install crontabs
apt install crontabscr
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><ol start="2"><li>crontab -e 编辑并添加一条定时任务</li></ol><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>*/1 * * * *  /usr/lcoal/nginx/cut_my_log.sh
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><ol start="3"><li>重启定时任务</li></ol><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>service crond restart
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h3 id="常用定时任务命令" tabindex="-1"><a class="header-anchor" href="#常用定时任务命令" aria-hidden="true">#</a> 常用定时任务命令</h3><ul><li>service crond start 启动</li><li>service crond stop 关闭</li><li>serivce crond restart 重启</li><li>service crond reload 重新载入配置</li><li>crontab -e 编辑</li><li>crontab -l 查看任务列表</li></ul><p><strong>Ubuntu 上 crond 改为 cron</strong></p><h3 id="cron-定时任务表达式" tabindex="-1"><a class="header-anchor" href="#cron-定时任务表达式" aria-hidden="true">#</a> Cron 定时任务表达式</h3><blockquote><p>Cron 表达式分为5或6个域，每个域代表一个含义</p></blockquote><table><thead><tr><th></th><th>分</th><th>时</th><th>日</th><th>月</th><th>周</th><th>年（可选）</th></tr></thead><tbody><tr><td>取值范围</td><td>0-59</td><td>0-23</td><td>1-31</td><td>1-12</td><td>1-7</td><td>2009/2010....</td></tr></tbody></table><h4 id="常用表达式" tabindex="-1"><a class="header-anchor" href="#常用表达式" aria-hidden="true">#</a> 常用表达式</h4><ul><li>每分钟执行</li></ul><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>*/1 * * * * 
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><ul><li>每日凌晨(每天晚上23:59)</li></ul><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>59 23 * * * 
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><ul><li>每日 1 点执行</li></ul><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>0 1 * * *
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h2 id="其余命令" tabindex="-1"><a class="header-anchor" href="#其余命令" aria-hidden="true">#</a> 其余命令</h2><blockquote><ul><li>whereis xxxx 软件安装目录</li><li>pwd 显示当前目录</li></ul></blockquote><h2 id="搜索文件内容" tabindex="-1"><a class="header-anchor" href="#搜索文件内容" aria-hidden="true">#</a> 搜索文件内容</h2><blockquote><p>grep -rn &#39;hello world&#39;</p></blockquote><ol><li>* 表示当前目录所有文件，也可以是某个文件名</li><li>-r 递归查找</li><li>-n 显示行号</li><li>-R 查找所有文件包含子目录</li><li>-i 忽略大小写</li></ol></div><!----><footer class="page-meta"><!----><div class="meta-item update-time"><span class="label">上次编辑于: </span><!----></div><!----></footer><!----><!----><!----><!--]--></main><!--]--><!----><!--]--></div><!--]--><!----><!--]--></div>
    <script type="module" src="/doc/assets/app.41440b49.js" defer></script>
  </body>
</html>
